#include "visualizadorListaCircularStl.h"
//------------------------------------------------------------------------------
visualizadorListaCircularStl::visualizadorListaCircularStl(float x,float y):visualizadorAbstrato(x,y)
{
	lstListaCircularStl = new ListaCircularStl;
};
//------------------------------------------------------------------------------
visualizadorListaCircularStl::~visualizadorListaCircularStl()
{
	delete lstListaCircularStl;
	lstListaCircularStl = NULL;
};
//------------------------------------------------------------------------------
void visualizadorListaCircularStl::desenha(TImage *area, double escalaX,double escalaY)const
{
		area->Canvas->Brush->Color = clTeal;
		area->Canvas->Rectangle((getX())*escalaX,(getY())*escalaY,(getX()+44)*escalaX,(getY()+44)*escalaY);
		if (escalaX == 1)
		{
				area->Canvas->Brush->Color = clWhite;
				area->Canvas->Rectangle((getX()+2)*escalaX,(getY()+6)*escalaY,(getX()+25)*escalaX,(getY()+37)*escalaY);

				//linhas da lista
				area->Canvas->MoveTo(getX()+5,getY()+10);
				area->Canvas->LineTo(getX()+20,getY()+10);
				area->Canvas->MoveTo(getX()+5,getY()+13);
				area->Canvas->LineTo(getX()+20,getY()+13);
				area->Canvas->MoveTo(getX()+5,getY()+16);
				area->Canvas->LineTo(getX()+20,getY()+16);
				area->Canvas->MoveTo(getX()+5,getY()+19);
				area->Canvas->LineTo(getX()+20,getY()+19);
				area->Canvas->MoveTo(getX()+5,getY()+22);
				area->Canvas->LineTo(getX()+20,getY()+22);
				area->Canvas->MoveTo(getX()+5,getY()+25);
				area->Canvas->LineTo(getX()+20,getY()+25);

				//bolinha
				area->Canvas->Brush->Color = clTeal;
				area->Canvas->Ellipse((getX()+27)*escalaX,(getY()+06)*escalaY,(getX()+37)*escalaX,(getY()+17)*escalaY);
				//texto
				area->Canvas->Brush->Color = clWhite;
				area->Canvas->TextOutA((getX()+6)*escalaX,(getY()+29)*escalaY,"ListaCStl" +IntToStr(getIdentidade()));
		}
};
//------------------------------------------------------------------------------
void visualizadorListaCircularStl::interage()
{
	TfrmListaCircularStl * frmListaCircularStl = new TfrmListaCircularStl(Application, lstListaCircularStl);
	frmListaCircularStl->ShowModal();
	delete(frmListaCircularStl);
	frmListaCircularStl = NULL;
};
//------------------------------------------------------------------------------

